<?php
/*
Module Group: webSite
Module Group Name: 微网站
Description: 微网站模块用于展示网站页面
Version: 1.0
Iconurl: http://www.happyidea.com.cn/resource/wx_icon/webpage.png
Author: lr
Modules: webSite
Display: 1
*/
class webSiteModule extends Module {
	/*
	 * 在构造函数中装载所依赖的类或其他文件
	*/
	function __construct() {
		$this->includePhp('webSite', 'webSite');
	}
	
	/*
	 * 调用插件资源
	*/
	public function call($user, $method, $param) {
		switch ($method) {
			case 'getWebSite':
				$id = $param->id;
				if (!isset($id)) {
					Output::instance()->resultCode(code_lackof_param);
					return;
				}
				if (isset($param->rootid)) {
					$rootId = $param->rootid;
				} else {
					$rootId = NULL;
				}
				webSite::getWebSiteById($id, $user, $rootId);
				break;
			case 'getWebSiteTag':	// 废弃，请用webpage替代
				$tagName = $param->tagname;
				$id = $param->id;
				$start = $param->start;
				$tplid = $param->tplid =='' || $parm->tplid == 'undefined' ?1:$param->tplid;
				if (!isset($tagName) && !isset($id)) {
					Output::instance()->resultCode(code_lackof_param);
					return;
				}
				if (!isset($start)) {
					$start = 0;
				}
				$limit = 10;
				if (isset($tagName)) {
					$field = 'tagName';
					$value = $tagName;
				} else if (isset($id)) {
					$field = 'id';
					$value = $id;
				}
				webSite::getWebSiteTag($field, $value, $start, $limit,$tplid);
				break;
		}
	}
	
}


$module = new webSiteModule();
Module::addModule($module);
?>